<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Vue基础</title>
</head>

<body>
  <div id="app">
    <input type="button" v-on:click="clickone" value="第一题目">
    <input type="button" v-on:click="clicktwo" value="第2题目">
    {{ message }}
  </div>
  <!-- 开发环境版本，包含了有帮助的命令行警告 -->
  <script src="../../../../Users/admin/Desktop/专高二笔记/vue.js"></script>
  
  <script>

   var app =  new Vue({
      el:"#app",
      data:{
        message:""
      },
      created() {
        this.message ='我出生了'
      },
      methods: {
        clickone(){
        
           let cc =[1,2,3,4]
           var pf = cc.map(x=>x*x)
           console.log(pf)

        },
        clicktwo(){
            let cc =[1,2,3,4]
            cc.forEach( function(i,j){
                  console.log(i)
                  console.log(j)
            })

            console.log("####################")
            

            cc.forEach( (a,b)=>{
                  console.log(a)
                  console.log(b)
            })
        }
      }
        
    })
    
  </script>
</body>

</html>